<?php
// +----------------------------------------------------------------------
// | astp [ WE ONLY DO WHAT IS NECESSARY ]
// +----------------------------------------------------------------------
// | Author 荒年 < 931274989@qq.com >
// +----------------------------------------------------------------------
// | Explain 大转盘
// +----------------------------------------------------------------------
namespace app\admin\controller;

use think\Controller;
use app\admin\model\Zpgame as zpgameModel;

class Zhuanpan extends Controller
{
  public function rule()
  {
    $model = new zpgameModel();
    if(Request()->isPost()){
      $post = input('post.');
      if($model->save($post,['char'=> $post['char']])){
        return $this->success('修改成功');
      } else {
        return $this->error('修改失败');
      }
    } else {
      $char= request()->param('char');
      $rule = $model->where('char','=',$char)->find();
      $this->assign('rule',$rule);
      return view();
    }
  }
  
}
?>